<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>首页</title>
    <!-- Bootstrap -->
    <link href="framework/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="framework/jquery/jquery-1.11.3.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="framework/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <!--custom-->
    <link href="css/index.css" rel="stylesheet">
    <!--template-->
    <script src="framework/templates/template.js"></script>

    <script src="framework/Highcharts-5.0.13/code/highcharts.js"></script>
    <script src="framework/Highmaps-5.0.12/code/modules/map.js"></script>

    <script src="framework/Highmaps-5.0.12/code/china.js"></script>
    <script src="framework/Highmaps-5.0.12/code/themes/dark-unica.js"></script>

    <!--marquee-->
    <link href="css/marquee.css" rel="stylesheet">
    <script src="framework/marquee/marquee.js"></script>
    <!--websoket-->
    <script src="framework/websocket/socket-common.js"></script>
</head>
<body>

<div class="container-fluid">
    <!--header-->
    <div class="row padder-v-lg">
        <div class="col-md-9">
            <h1 class="header-title">成都千嘉客户服务感知管理系统<small>CHENGDU QIANJIA TECHNOLOGY CO.,LTD</small></h1>
        </div>
        <div class="col-md-1"></div>
        <div class="col-md-2">
            <a href="/index.html" class="back"></a>
        </div>
    </div>
    <!--content-->
    <div class="row">
        <!--left-->
        <div class="col-md-9">
            <iframe class="map-md" width="100%" src="http://192.168.0.17:9613/mrms/j_spring_security_check?p=WqJfB2GmubcY0grdKd7uDw==" frameborder="0" allowfullscreen=""></iframe>
        </div>
        <!--right-->
        <div class="col-md-3">
            <!--hignchar-->
            <div class="row">
                <div class="col-md-12">
                    <div class="part">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="wrapper-spe">
                                    <span class="content">民用表运行情况</span>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="divide-line"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="wrapper-sm">
                                    <div class="highchar-content">

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--second-->
            <div class="row m-t-md">
                <div class="col-md-12">
                    <div class="part">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="wrapper-spe">
                                    <span class="content">抄表数据回家</span>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="divide-line"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="padder-v padder-l-xs">
                                    <span class="span-base span-hg span-zt1 span-flex">
                                        <div>
                                            <p>客户总数</p>
                                            <p id="MY_KEHU"></p>
                                        </div>
                                    </span>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="padder-v padder-r-xs">
                                    <span class="span-base span-hg span-zt1 span-flex">
                                        <div>
                                            <p>投运总量</p>
                                            <p id="MY_TOUYUN_ZONGSHU"></p>
                                        </div>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="padder-v padder-l-xs">
                                    <span class="span-base span-hg span-zt2 span-flex">
                                        <div>
                                            <p>已回家客户数</p>
                                            <p id="CBHJ_KEHU"></p>
                                        </div>
                                    </span>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="padder-v padder-r-xs">
                                    <span class="span-base span-hg span-zt2 span-flex">
                                        <div>
                                            <p>已回家用户数</p>
                                            <p id="CBHJ_YONGHU"></p>
                                        </div>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


</body>

<script type="text/javascript">
    $(function () {
        initData();
    });

    function initData(){
        var url = "/qjzt/data";
        $.post(url, {}, function (resp) {
            //初始化工业、信息化数据
            if(resp.attributes && resp.attributes.data){
                var map = resp.attributes;
                var data = map.data;

                //初始化民用表char
                var categories = map.categories;
                var series1 = map.series1;
                var series2 = map.series2;
                var series3 = map.series3;
                var series4 = map.series4;
                initChar(categories, series1, series2, series3, series4);

                //初始化抄表数据回家
                $("#MY_KEHU").html(data.MY_KEHU);
                $("#MY_TOUYUN_ZONGSHU").html(parseInt(parseInt(data.MY_TOUYUN_ZONGSHU) / 10000) + " 万");
                $("#CBHJ_KEHU").html(data.CBHJ_KEHU);
                $("#CBHJ_YONGHU").html(parseInt(parseInt(data.CBHJ_YONGHU) / 10000) + " 万");
            }
        })
    }

    function initChar(categories, series1, series2, series3, series4){
        $('.highchar-content').highcharts({
            colors: ["#23c3fd", "#fc198f", "#a4ca57"],
            chart: {
                zoomType: 'xy',
                style: {
                    fontSize: "15px"
                }
            },
            title: {
                text: null
            },
            xAxis: [{
                categories: categories,
                crosshair: true,
                labels: {
                    style: {
                        fontSize: "15px"
                    }
                }
            }],
            yAxis: [{ // Primary yAxis
                labels: {
                    format: '{value}',
                    style: {
                        color: "#c4c6ca",
                        fontSize: "15px"
                    }
                },
                title: {
                    text: '单位<br>(万只)',
                    style: {
                        color: "#c4c6ca"
                    },
                    rotation: 0,
                    y: -30,
                    offset: 30
                }
            }, { // Secondary yAxis
                labels: {
                    format: '{value} %',
                    style: {
                        color: "#c4c6ca",
                        fontSize: "15px"
                    }
                },
                title: {
                    text: '抄表率',
                    style: {
                        color: "#c4c6ca"
                    },
                    rotation: 0,
                    y: -30,
                    offset: 40
                },
                opposite: true
            }],
            tooltip: {
                shared: true
            },
            legend: {
                enabled: false
            },
            series: [{
                name: '投运量',
                type: 'column',
                yAxis: 0,
                data: series1,
                tooltip: {
                    valueSuffix: ' 万'
                }
            },{
                name: '抄表数',
                type: 'column',
                yAxis: 0,
                data: series2,
                tooltip: {
                    valueSuffix: ' 万'
                }
            },{
                name: '抄表成功数',
                type: 'column',
                yAxis: 0,
                data: series3,
                tooltip: {
                    valueSuffix: ' 万'
                }
            }, {
                name: '抄表率',
                type: 'spline',
                yAxis: 1,
                data: series4,
                tooltip: {
                    valueSuffix: ' %'
                },
                color: "#f38b08",
                lineWidth: 4
            }]
        });
    }

</script>
</html>